<!--
   Copyright 2024 The Google Research Authors.
  
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
  
       http://www.apache.org/licenses/LICENSE-2.0
  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<!DOCTYPE html>
<html>
<head>
<title>gMiniWoB Web Environment</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- stylesheets -->
<style class="anchorjs"></style>
<link rel="stylesheet" href="../bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="../miniwob-plusplus/html/core/jquery-ui/jquery-ui.min.css">
<link rel="stylesheet" href="env-design.css">

<!-- JS -->
<script src="../miniwob-plusplus/html/core/core.js"></script>
<script src="../miniwob-plusplus/html/core/d3.v3.min.js"></script>
<script src="../miniwob-plusplus/html/common/ui_utils.js"></script>

<script src="../miniwob-plusplus/html/core/jquery-ui/external/jquery/jquery.js"></script>
<script src="../miniwob-plusplus/html/core/jquery-ui/jquery-ui.min.js"></script>
<script src="../bootstrap/bootstrap.min.js"></script>
<script src="env-design.js"></script>
<script>
core.EPISODE_MAX_TIME = 600000;
var NUM_PAGES = 1;
var CONCEPTS = null;
var nodeCreateFn = null;
var edgeCreateFn = null;
var USE_CONCEPTUAL = false; // A global variable that will compute reward conceptually

var genProblem = function(){
  if (nodeCreateFn == null){
    console.log("Creating empty nodes");
    var sitemap = addNodes({"num_pages": 1, "actions": []}); // empty website
  }
  console.log("Sitemap:", sitemap);
  if (edgeCreateFn == null){
    console.log("Creating empty edges");
    addEdges({"actions": []}); // no transition
  }
  console.log(["use conceptual = ", USE_CONCEPTUAL]);
  // This is where nodes and edges are actually added.
  nodeCreateFn();
  edgeCreateFn();
  // Check and connect web pages if they are disconnected.
  connectGraph({"conceptual": USE_CONCEPTUAL, "taskSuccessScale": 1.0, "preconditionVisited": []});
}

window.onload = function() {
  core.startEpisode();
}
</script>
</head>
<body>
<div id="wrap">
  <div id="query"></div>
  <div id="area">
  </div>

</div>
</body>
</html>
